import Vue from 'vue'

import App from './App.vue'
import router from './router'
import * as API from './api'
import store from './store'
import TypeNav from './components/TypeNav'
import Pagination from './components/Pagination'
import mockServer from './mock/mockServer'
import 'swiper/css/swiper.min.css'
import VueLazyload from 'vue-lazyload'
//引入element-ui部分组件
import {Message,Loading,MessageBox,Notification} from 'element-ui'
//引入校验规则
import '@/utils/validate'
import lazy  from '@/assets/lazy.gif'
Vue.config.productionTip = false


 //图片懒加载
Vue.use(VueLazyload,{
  loading:lazy
})
//将API请求函数放到vue 原型上
Vue.prototype.$API=API
//element-ui组件添加到Vue.prototype中
Vue.prototype.$loading = Loading.service;
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;
Vue.prototype.$confirm = MessageBox.confirm;
Vue.prototype.$prompt = MessageBox.prompt;
Vue.prototype.$notify = Notification;
Vue.prototype.$message = Message;

Vue.component(TypeNav.name,TypeNav)
Vue.component(Pagination.name,Pagination)

new Vue({
  //全局事件总线
  beforeCreate() {
    Vue.prototype.$bus=this
  },
  render: h => h(App),
  router,
  store
}).$mount('#app')
